<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <link type="text/css" rel="stylesheet" href="base.css" />

    <script type="text/javascript" src="jquery.min.js"></script>

    <script type="text/javascript" src="jtopo-0.4.8-min.js"></script>
    <script>



$(document).ready(function(){
  var a={"nodes":[{"tooltip":"internet"},{"label":"172.16.1.1,---------Router"},{"label":"192.168.1.18,---------Switch"},{"label":"1----192.168.1.12"},{"label":"2----192.168.1.27"},{"label":"4----192.168.1.2"},{"label":"5----192.168.1.29"},{"label":"7----192.168.1.37"},{"label":"9----192.168.1.7"},{"label":"11----192.168.1.10"},{"label":"12----192.168.1.67"},{"label":"15----192.168.1.5"},{"label":"16----192.168.1.8"},{"label":"18----192.168.1.17"},{"label":"19----192.168.1.4"},{"label":"20----192.168.1.9"},{"label":"21----192.168.1.11"},{"label":"23----192.168.1.39---------Switch"},{"label":"24----192.168.1.3"}],"edges":[{"source":"internet","target":"172.16.1.1","label":"172.16.1.1","tooltip":""},{"source":"172.16.1.1","target":"192.168.1.18","label":"192.168.1.18","tooltip":""},{"source":"192.168.1.18","target":3,"label":"1----192.168.1.12","tooltip":"1----192.168.1.12"},{"source":"192.168.1.18","target":4,"label":"2----192.168.1.27","tooltip":"2----192.168.1.27"},{"source":"192.168.1.18","target":5,"label":"4----192.168.1.2","tooltip":"4----192.168.1.2"},{"source":"192.168.1.18","target":6,"label":"5----192.168.1.29","tooltip":"5----192.168.1.29"},{"source":"192.168.1.18","target":7,"label":"7----192.168.1.37","tooltip":"7----192.168.1.37"},{"source":"192.168.1.18","target":8,"label":"9----192.168.1.7","tooltip":"9----192.168.1.7"},{"source":"192.168.1.18","target":9,"label":"11----192.168.1.10","tooltip":"11----192.168.1.10"},{"source":"192.168.1.18","target":10,"label":"12----192.168.1.67","tooltip":"12----192.168.1.67"},{"source":"192.168.1.18","target":11,"label":"15----192.168.1.5","tooltip":"15----192.168.1.5"},{"source":"192.168.1.18","target":12,"label":"16----192.168.1.8","tooltip":"16----192.168.1.8"},{"source":"192.168.1.18","target":13,"label":"18----192.168.1.17","tooltip":"18----192.168.1.17"},{"source":"192.168.1.18","target":14,"label":"19----192.168.1.4","tooltip":"19----192.168.1.4"},{"source":"192.168.1.18","target":15,"label":"20----192.168.1.9","tooltip":"20----192.168.1.9"},{"source":"192.168.1.18","target":16,"label":"21----192.168.1.11","tooltip":"21----192.168.1.11"},{"source":"192.168.1.18","target":17,"label":"23----192.168.1.39---------Switch","tooltip":"23----192.168.1.39---------Switch"},{"source":"192.168.1.18","target":18,"label":"24----192.168.1.3","tooltip":"24----192.168.1.3"}]};
var b=a.nodes;
//console.log(b);



//console.log(arr.length);
var tt=[];
for (var a = 0; a < b.length; a++) {
  //console.log(JSON.stringify(b[a]));
var g=JSON.stringify(b[a]);
var l=g.replace("{"," ");
var arr=l.replace("}",",");
//var cc=arr.split(",",1);
//k=arr;
console.log(arr);
// for (var f = 0; f < g.length; f++) {
//   var m=g[f];
//   var l=m.replace("{"," ");
//   var k=l.replace("}"," ");
// //  console.log( m);
//
// }
}

 });
    </script>
</head>
<body>
<div id="divShow"></div>
</body>
</html>
